<!-- eslint-disable vue/valid-template-root -->
<template>
  嵌入了
  <iframe
    :src="url"
    width="100%"
    height="100%"
    frameborder="0"
    scrolling="no"
  ></iframe>
  <el-dialog v-model="state.previewVisible" title="预览" :fullscreen="true">
    {{ state.tableData }}
    <hr />
    {{ state.searchData }}
    <ak-list
      :data="state.tableData"
      :search-data="state.searchData"
      v-if="state.previewVisible"
    />
  </el-dialog>
  <!-- <el-dialog v-model="state.previewVisible" title="预览" :fullscreen="true">
      <ak-list
        :data="state.tableData"
        :search-data="state.searchData"
        v-if="state.previewVisible"
      />
    </el-dialog> -->
</template>

<script setup lang="ts">
  import { ref, watchEffect } from 'vue'
  // watch, ref,
  //   console.log('xx', usePost)
  const props = withDefaults(
    defineProps<{
      modelValue?: string
      disabled?: boolean
      placeholder?: string
      configList?: object
    }>(),
    {}
  )
  // const value = ref(props.modelValue)
  // export const columns: ColumnProps[] = []
  const url = ref()
  // watch(
  //   () => props,
  //   () => {
  //     value.value = props.modelValue
  //     console.log(22222222222)
  //   },
  //   () => props?.configList?.componentColumns,
  //   () => {
  //     arr1.value = [props?.configList?.componentColumns]
  //     console.log(arr1.value, 111111111111)
  //   }
  // )
  watchEffect(() => {
    console.log(props?.configList?.componentUrl, '传入得数据')
    url.value = !props?.configList?.componentUrl
      ? ''
      : props?.configList?.componentUrl
    console.log(url.value, '接口前的数据')
    // 在这里可以拿到最新的 props 值，并进行相应的处理
  })
</script>
